package myJs.implicits

import argonaut.{Json, PrettyParams}

import scala.scalajs.js
import scala.scalajs.js.JSON

/**
 * Created by Administrator on 2020/1/16
 */
trait MyMapTool {

  implicit class MyMap(map: Map[String, String]) {

    def reverse = {
      map.map { case (k, v) =>
        (v -> k)
      }
    }

    def keyList = {
      map.keys.toList
    }

    def valueList = {
      map.values.toList
    }

  }

  implicit class MyMapVT[B](map: Map[String, B]) {

    def reverse = {
      map.map { case (k, v) =>
        (v -> k)
      }
    }

    def keyList = {
      map.keys.toList
    }

  }

}
